using System;
using System.Text.RegularExpressions;
using iCodeGenerator.DatabaseStructure;

namespace iCodeGenerator.Generator
{
    public class ColumnsCountExpression : Expression
    {

        public ColumnsCountExpression()
        {

        }

        public override void Interpret(Context context)
        {
            Table table = (Table)Parameter;
            context.Output = Regex.Replace(context.Input, Context.StartDelimeter + "COLUMNS.COUNT" + Context.EndingDelimiter, table.Columns.Count.ToString());
            context.Input = context.Output;
        }
    }
}